package cn.bdqn.commponent;



import cn.bdqn.domain.Registration;

import cn.bdqn.service.DiagnoseService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class OPCMQReceiveDirectHandel {
    @Autowired
    private DiagnoseService diagnoseService;

    @RabbitListener(queues = "OPC-Queue")//监听队列
    @RabbitHandler//处理
    public void getRegistration(Registration registration){

        diagnoseService.queryByDeptId(registration.getRegisDepartments());
        System.out.println(registration);

    }
}
